package com.xygz.orm.config;

import com.xygz.orm.utils.S;

/**
 * 表配置
 *
 * @author xiyuan-lgz 2023-11-01 @version v1.0.0 新建与整理
 */
@SuppressWarnings("all")
public class ORMConfig {
    private String tablePrefix;
    
    /**
     * 默认驼峰命名
     */
    private boolean camelCase = true;
    
    /**
     * SQL 大写
     */
    private boolean upperSQL = false;
    
    /**
     * 批次数量 默认1000条
     */
    private int batchCount = 2000;
    
    public String getTablePrefix() {
        return tablePrefix == null ? "" : tablePrefix;
    }
    
    public void setTablePrefix(String prefix) {
        this.tablePrefix = S.trimToEmpty(prefix);
    }
    
    public boolean isCamelCase() {
        return camelCase;
    }
    
    public void setCamelCase(boolean camelCase) {
        this.camelCase = camelCase;
    }
    
    public boolean isUpperSQL() {
        return upperSQL;
    }
    
    public void setUpperSQL(boolean upperSQL) {
        this.upperSQL = upperSQL;
    }
    
    public int getBatchCount() {
        return batchCount;
    }
    
    /**
     * 最小 两条
     */
    public void setBatchCount(int batchCount) {
        if (batchCount < 2) batchCount = 2;
        this.batchCount = batchCount;
    }
}
